package com.haskie.user.runner;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * 实现ApplicationRunner接口，容器启动完成的时候执行
 * 多个启动要执行的方法资源的时候order的整数越小越先执行
 */
@Slf4j
@Order(1)
@Component
public class SecondRunner implements ApplicationRunner {

    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info("容器启动完成了,my is second runner,I finished...");
    }
}
